function braintrainFileBrowser(field_name, url, type, win) {

    var appURL = window.location.pathname;      // script URL
    var page = "?page=FileBrowser&service=external&sp=S" + type;  // possible parameters

    tinyMCE.activeEditor.windowManager.open({
        file : appURL + page,
        title : "File Browser",
        width : 800,
        height : 600,
        resizable : "yes",
        inline : "yes",
        close_previous : "no"
    }, {
        window : win,
        input : field_name
    });
    return false;
}